# import numpy as np
import numpy.random as npr
# import pandas as pd
# import matplotlib as mpl
import matplotlib.pyplot as plt
# import statsmodels.api as sm
# import scipy.optimize as sco
# import numpy.random as npr
import seaborn as sns

# 显示中文
sns.set_style({"font.sans-serif": ["Microsoft YaHei", 'SimHei']})
size = 1000
rn1 = npr.standard_normal(size)
# 设置画板
sns.set_palette("muted")
fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(10, 10))
# 设置了25个盒子
ax1.hist(rn1, bins=25)
ax1.set_title('fig1')
sns.distplot(rn1, bins=25, kde=False, ax=ax2)
ax2.set_title('fig2')
sns.distplot(rn1, bins=25, kde=True, ax=ax3)
ax3.set_title('fig3')
# kde是核密度估计，rug是毛毯图，这里要自己去理解什么是毛毯图和核密度估计
sns.distplot(rn1, bins=25, kde=True, rug=True, ax=ax4)
ax4.set_title('fig4')

plt.show()
